<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/3/21
  Time: 16:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false"%>
<%--  BootStrap--%>
<link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<html>
<head>
    <title>修改书籍</title>
    <script src="${pageContext.request.contextPath}/js/jquery-3.6.0.js"></script>
    <script>
        function a1() {
            $.post({
                url:"${pageContext.request.contextPath}/a3",
                data:{"name":$("#bkname").val()},
                success:function (data) {
                    $("#productsize").css("color","red");
                    $("#productsize").html(data);
                }
            })
        }
    </script>
</head>
<body style="background-color:#e7e7e7 ">
<div class="container" style="background-color: #e7e7e7">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>修改销售信息</small>
                </h1>
            </div>
        </div>
        <div>
            <form action="${pageContext.request.contextPath}/sale/update" method="get">
                <div class="form-group" style="display: none">
                    <label for="bkname0">id</label>
                    <input type="text"  class="form-control" name="id" value="${saleById.id}" id="bkname0" required>
                </div>
                <div class="form-group" style="display: none">
                    <label for="bkname">商品名字</label>
                    <input type="text"  name="name" class="form-control" value="${saleById.name}" id="bkname" required>
                </div>

                <div class="form-group" style="display: none">
                    <label for="bkname1" >价格</label>
                    <input type="text" name="price" class="form-control" id="bkname1" VALUE="${saleById.price}" required>
                </div>
                <div class="form-group">
                    <label for="bkname2">数量</label>
                    <span id="productsize"></span>

                    <c:if test="${sessionScope.msgxiugai!=null}">
                        <span>${sessionScope.msgxiugai}</span>
                    </c:if>
                    <input type="text" onclick="a1()" name="number" class="form-control" value="${saleById.number}" id="bkname2" required>
                </div>
                <div class="form-group">
                    <label for="bkname3">时间</label>
                    <input type="text" name="date" class="form-control" value="${saleById.date}" id="bkname3" required>
                </div>
                <div class="form-group" style="display: none">
                    <label for="bkname4">电话</label>
                    <input type="text" name="tellpone" class="form-control" value="${saleById.tellpone}" id="bkname4">
                </div>
                <div class="form-group" style="display: none">
                    <label for="bkname5">供应商</label>
                    <input type="text" name="sump" class="form-control" value="${saleById.sump}" id="bkname5" required>
                </div>
                <div class="form-group">
                    <label for="bkname10">detail</label>
                    <input type="text" name="detail" class="form-control" value="${saleById.detail}" id="bkname10" required>
                </div>
                <div class="form-group">
                    <input type="submit" class="form-control" value="修改">
                </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>